﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GreenPepperTest
{
    class MotionDetector
    {
        string location;
        double sensitivity;
        bool isActive;
        bool isAlarmTripped;

        public string Location
        {
            get
            {
                return location;
            }
            set
            {
                location = value;
            }
        }

        public double Sensitivity
        {
            get
            {
                return sensitivity;
            }
            set
            {
                sensitivity = value;
            }
        }

        public bool IsOn
        {
            get
            {
                return isActive;
            }
            set
            {
                isActive = value;
            }
        }

        public bool IsAlarmTripped
        {
            get
            {
                return isAlarmTripped;
            }
        }

        public MotionDetector()
        {
            location = "";
            sensitivity = 1.0;
            isActive = false;
            isAlarmTripped = false;
        }

        public MotionDetector(string loc)
        {
            location = loc;
            sensitivity = 1.0;
            isActive = true;
            isAlarmTripped = false;
        }

        public void TripAlarm()
        {
            isAlarmTripped = true;
        }

        public void ResetAlarm()
        {
            isAlarmTripped = false;
        }

    }
}
